home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
xsw
/
miscvbt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-09
|
7KB
|
243 lines
/*
* @(#) miscvbt.c 12.1 95/05/09 SCOINC
*/
/***************************************************************************
*
* Copyright (c) 1990-1993 The Santa Cruz Operation, Inc.
*
* All rights reserved. No part of this program or publication may be
* reproduced, transmitted, transcribed, stored in a retrieval system,
* or translated into any language or computer language, in any form or
* by any means, electronic, mechanical, magnetic, optical, chemical,
* biological, or otherwise, without the prior written permission of:
*
* The Santa Cruz Operation , Inc. (408) 425-7222
* 400 Encinal St., Santa Cruz, California 95060 USA
*
**************************************************************************/
/*
* Modification History
*
* S001, 15-Sep-93, rickra
* Added a XSetForeground for a line draw
*
* S000, 27-May-93
* Checked into SCCS tree for the first time, no duh....
*
*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#include <Xm/MainW.h>
#include <Xm/DrawingA.h>
#include "include/unixincs.h"
#include "include/buttons.h"
#include "include/xsw.h"
static int line_style = LineSolid;
static int cap_style = CapButt;
static int join_style = JoinMiter;
/*+-------------------------------------------------------------------------
draw_MiscVBT(SP,x,y)
--------------------------------------------------------------------------*/
void
draw_MiscVBT (SP, x, y)
struct NetworkXswStruct *SP;
int x;
int y;
{
Window window = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].window;
Display *display = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].display;
GC gc = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].gc;
XWindowAttributes DrawAreaXYWH = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].DrawAreaXYWH;
Pixmap pixmap = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].pixmap;
char s80[80];
char s256[256];
char s1024[1024];
char *temp_s;
char *cptr;
int fwidth = FWIDTH;
int fheight = FHEIGHT;
int len;
int x2 = x;
int yl1 = y + (FASCENT / 2);
int ys = y + FASCENT;
int j = 0;
int current_length = 0;
int tab_count = 0;
/* the "background" bar */
XSetForeground (display, gc, colorTitleBarBG.pixel);
XSetLineAttributes (display, gc, fheight, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc, x, yl1, x + (len * fwidth), yl1);
*/
XDrawLine (display, pixmap, gc, x, yl1,
SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].width, yl1);
/* draw the black line before "Var" */
XSetForeground (display, gc, colorTitleBarFG.pixel);
XSetLineAttributes (display, gc, FASCENT / 2, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
*/
XDrawLine (display, pixmap, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
x2 += len;
/* draw "Var" */
cptr = "Boot String";
/*
XDrawString (display, window, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, window, gc, x2 + 1, ys, cptr, len = strlen (cptr));
*/
XDrawString (display, pixmap, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, pixmap, gc, x2 + 1, ys, cptr, len = strlen (cptr));
x2 += fwidth * len;
/* draw the black line after "string ...." */
/*
XDrawLine (display, window, gc,
x2 + FGAP + 1, yl1,
x2 + (len = (fwidth * 10)), yl1);
*/
XDrawLine (display, pixmap, gc,
x2 + FGAP + 1, yl1,
x2 + SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].width, yl1);
y += fheight;
sprintf (s80, "%s", SP -> bootstring);
/*
XDrawString (display, window, gc, x,
y + FASCENT, s80, strlen (s80));
*/
XSetForeground (display, gc, colorLabel.pixel);
XDrawString (display, pixmap, gc, x,
y + FASCENT, s80, strlen (s80));
y += fheight;
yl1 = y + (FASCENT / 2);
ys = y + FASCENT;
x2 = x;
/* the "background" bar */
XSetForeground (display, gc, colorTitleBarBG.pixel);
XSetLineAttributes (display, gc, fheight, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc, x, yl1, x + (len * fwidth), yl1);
*/
XDrawLine (display, pixmap, gc, x, yl1,
SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].width, yl1);
/* draw the black line before "Var" */
XSetForeground (display, gc, colorTitleBarFG.pixel);
XSetLineAttributes (display, gc, FASCENT / 2, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
*/
XDrawLine (display, pixmap, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
x2 += len;
/* draw "Var" */
cptr = "Boot Configuration";
/*
XDrawString (display, window, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, window, gc, x2 + 1, ys, cptr, len = strlen (cptr));
*/
XDrawString (display, pixmap, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, pixmap, gc, x2 + 1, ys, cptr, len = strlen (cptr));
x2 += fwidth * len;
/* draw the black line after "string ...." */
/*
XDrawLine (display, window, gc,
x2 + FGAP + 1, yl1,
x2 + (len = (fwidth * 10)), yl1);
*/
XDrawLine (display, pixmap, gc,
x2 + FGAP + 1, yl1,
x2 + SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].width, yl1);
y += fheight;
XSetForeground (display, gc, colorLabel.pixel);
cptr = "device address vector dma comment";
XDrawString (display, pixmap, gc, 0,
y + FASCENT, cptr, strlen (cptr));
y += fheight;
cptr = "--------------------------------------------------------------------------------";
XDrawString (display, pixmap, gc, 0,
y + FASCENT, cptr, strlen (cptr));
y += fheight;
/*
* Need to parse the string and replace "TABS" with spaces... also
* we need to find end-of-lines.....
*/
temp_s = (char *) malloc (1024);
strcpy (temp_s, "");
for (j = 0; j < 1024; j++)
{
if (SP -> configuration_string[j] == 9)
{
current_length = strlen (temp_s);
strncat (temp_s, " ", (8 - (current_length % 8)) + tab_count);
tab_count++;
}
else if (SP -> configuration_string[j] == 10)
{
sprintf (s1024, "%s", temp_s);
XDrawString (display, pixmap, gc, 0,
y + FASCENT, s1024, strlen (s1024));
strcpy (temp_s, "");
tab_count = 0;
y += fheight;
}
else
{
strncat (temp_s, &SP -> configuration_string[j], 1);
tab_count = 0;
}
}
free (temp_s);
} /* end of draw_Var */
/* vi: set tabstop=4 shiftwidth=4: */
/* end of var.c */